package com.cj.controller;

import com.cj.po.Dormitoryinfo;
import com.cj.po.PageInfo;
import com.cj.service.DormitoryStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller

public class DormitoryStudentController {

    // 依赖注入
    @Autowired
    private DormitoryStudentService dormitoryStudentService; // 修改为小写 dormitoryStudentService

    @RequestMapping(value = "/findDormitoryStudent")
    public String findClass(String s_dormitoryid, Integer pageIndex, Integer pageSize, Model model) {

//        // 获取分页信息
        PageInfo<Dormitoryinfo> pi = dormitoryStudentService.findPageInfo(s_dormitoryid,
                pageIndex, pageSize);
        model.addAttribute("ds", pi);

//        model.addAttribute("c_classname", c_classname);
        return "dormitory_Studentlist"; // 返回视图
    }


}
